package de.bytecake.snoobud.bootstrap.logging;

import org.apache.log4j.FileAppender;
import org.apache.log4j.Logger;
import org.apache.log4j.PatternLayout;

/**
 * The Snoobud Logger
 * @author Dirk
 */
public class ApplicationLogger {
    
    private static Logger logger;
    private static PatternLayout layout;
    private static FileAppender appender;
    
    static{
        try {
            logger = Logger.getRootLogger();
            layout = new PatternLayout();
            layout.setConversionPattern("%d - %p - %C: %m %n");
            appender = new FileAppender(layout, "logs/log.txt", true);
            logger.addAppender(appender);
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
    }
    
    public static Logger getAppLogger(){
        return logger;
    }
}
